package edu.ufrj.pesc.softwaregraph;

public class SoftwareGraphEdge {
	private SoftwareGraphNode from;
	private SoftwareGraphNode to;
	private String type;
	private boolean mark;
	

	public SoftwareGraphEdge(SoftwareGraphNode _from)
	{
		from = _from;
		to = null;
		type = null;
		mark = false;
	}	
	
	public SoftwareGraphEdge(SoftwareGraphNode one, SoftwareGraphNode two)
	{
		from = one;
		to = two;
		type = null;
		mark = false;
	}
	
   public SoftwareGraphNode getTo()
   {
      return to;
   }
   public SoftwareGraphNode getFrom()
   {
      return from;
   }

	// Mark an edge
	public void mark()
	{
		mark = true;
	}
	
	// Clear the mark
	public void clearMark()
	{
		mark = false;
	}
	
	// Test the mark
	public boolean isMarked()
	{
		return mark;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String _type) {
		this.type = _type;
	}	
	
	public String toString()
	{
	  StringBuffer tmp = new StringBuffer("Edge[from: ");
      tmp.append(from.getName());
      tmp.append(",to: ");
      tmp.append(to.getName());
      tmp.append("]");
      return tmp.toString();
	}
}
